package com.yidao.menu.service;

import com.yidao.menu.domain.Menu;
import com.yidao.menu.domain.MenuItem;

class GroovyMenuFactory implements MenuFactory{
	Menu createMenu(){
		new Menu(
				menuItems:[
					 new MenuItem(id:"menu_item_1",name:"客户管理",value:"/main/customers",defaultSubItemId:"menu_item_101",
						 subMenuItems:[
				              new MenuItem(id:"menu_item_101",name:"客户列表",value:"/main/customers"),
				              new MenuItem(id:"menu_item_102",name:"客户搜索",value:"/main/customers/search"),
				              new MenuItem(id:"menu_item_103",name:"添加客户",value:"/main/customers/new")
				         ]
					 ),
					 new MenuItem(id:"menu_item_2",name:"个人设置",value:"/main/users/",
						 subMenuItems:[
						      new MenuItem(id:"menu_item_201",name:"个人信息",value:"/main/users/edit"),
						      new MenuItem(id:"menu_item_203",name:"修改密码",value:"/main/users/password")
						 ]
					 ),
					 new MenuItem(id:"menu_item_3",name:"模板管理",value:"/main/templates/",
						 subMenuItems:[
						      new MenuItem(id:"menu_item_301",name:"模板列表",value:"/main/templates/list"),
						      new MenuItem(id:"menu_item_302",name:"创建模板",value:"/main/templates/new")
						 ]
					 ),
					 new MenuItem(id:"menu_item_4",name:"系统维护",value:"/main/system/",
						 subMenuItems:[
						      new MenuItem(id:"menu_item_401",name:"数据备份",value:"/main/system/backups"),
						      new MenuItem(id:"menu_item_402",name:"模板引擎",value:"/main/system/plugins")
					     ]
					 ),
					 //new MenuItem(id:"menu_item_5",name:"辅助功能",value:"value4"),
					 new MenuItem(id:"menu_item_6",name:"退出",value:"/j_spring_logout")
				],
				defaultSubItemId:"menu_item_1"
		)
	}
}